package com.yuxue.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.yuxue.service.DemoService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


@Api(description = "在java中调用kettle生成的作业、转换")
@RestController
@RequestMapping("/demo")
public class DemoController {
    
    @Value("${jobs.transFilePath}")
    private String transFilePath;

    @Autowired
    private DemoService demoService;


    // @PostConstruct
    @Scheduled(cron = "${jobs.runTrans}")
    @ApiOperation(value = "测试执行转换", notes = "")
    @RequestMapping(value = "", method = RequestMethod.POST)
    public Object runTrans() {
        demoService.runTrans(transFilePath);
        return null;
    }
    

}

